﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BatallaNavalgo
{
    public class FragmentoDeNave
    {
        private int[] posicion;
        private int resistencia;
        private Nave nave;
        /*****************************************************/

        public FragmentoDeNave(int[] posicion, int resistencia, Nave nave)
        {
            this.posicion = new int[2];
            Array.Copy(posicion,this.posicion,2);
            this.resistencia = resistencia;
            this.nave = nave;
        }

        /*****************************************************/

        public int[] Posicion
        {
            get { return this.posicion; }
            set { Array.Copy(value,this.posicion,2); }
        }

        /*****************************************************/

        public void SetPosicion(int[] posicion)
        {
            Array.Copy(posicion, this.posicion, 2);
        }

        /****************************************************/
        public Nave Nave
        {
            get { return this.nave; }
        }
        /*****************************************************/

        public bool EstaDestruido()
        {
            if (this.resistencia == 0)
                return true;
            return false;
        }

        /*****************************************************/

        public void RecibirImpacto()
        {
            if (this.EstaDestruido() == false)
                this.resistencia--;
        }


    }


}
